package com.yubest.seatastock.controller;

import com.yubest.seatastock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/stock")
public class StockController {

    @Autowired
    private StockService stockService;

    /**
     * 扣库存
     * @return
     */
    @PostMapping(value = "/sub")
    public Boolean sub(@RequestParam Integer skuId, @RequestParam Integer stock) {
        return stockService.sub(skuId, stock);
    }
}
